<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .hide {
      display: none;
    }
    .show {
      display: block;
    }
  </style>
</head>
<body>
  <button id="btn">显示/隐藏</button>
  <div class="erweima hide" id="er">二维码</div>
  <script src="./common.js"></script>
  <script>
    // 7. <div class="erweima hide" id="er">，将class的属性值中的hide更换为show，其他保持不变，请写出适合的方法。
    
    var btn = my$('#btn')
    var er = my$('#er')
    btn.onclick = function () {
      if (er.className.indexOf('hide') > -1) {
        er.className = er.className.replace('hide', 'show')
      } else {
        er.className = er.className.replace('show', 'hide')
      }
    }
  </script>
</body>
</html>